# -*- coding: utf-8 -*-


import pygame

from cell import Cell


class Wall(Cell):
    """墙壁类
    主要是用来统一程序中一扇墙壁的大小

    """

    def __init__(self, width, height, screen, color=pygame.Color('#222222')):
        super(Wall, self).__init__(screen, color)

        self.width = width
        self.height = height

    def get_width(self, des='vertical'):
        """
        重载父类，加入判断水平方向还是竖直，默认竖直
        """
        if des == 'vertical':
            return self.width
        else:
            return self.height

    def get_height(self, des='vertical'):
        if des == 'vertical':
            return self.height
        else:
            return self.width

    def draw_horizontal(self, x, y):
        """画 水平方向的墙面
        """
        self.draw(x, y, self.height, self.width)

    def draw_vertical(self, x, y):
        self.draw(x, y, self.width, self.height)

    def get_horizontal_wall_size(self):
        """
        水平方向的强的高度和宽度正好颠倒过来
        """
        return self.height, self.width

    def get_vertical_width(self):
        return self.width

    def get_horizontal_height(self):
        return self.width

    def get_veritcal_wall_size(self):
        return self.width, self.height